import 'dart:convert';

import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

part 'search_state.dart';

class HomeIndexCubit extends Cubit<HomeIndexState> {
  HomeIndexCubit() : super(HomeIndexState(cardList: [])) {
    loadJson();
  }

  loadJson() async {
    String value = await rootBundle.loadString('assets/files/01.json');
    List<dynamic> list = jsonDecode(value);
    debugPrint(list.elementAt(0)['name']);
    emit(HomeIndexState(cardList: list));
  }
}
